<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>Archive::Extract - A generic archive extracting mechanism - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of Archive-Extract - MetaCPAN" href="https://metacpan.org/dist/Archive-Extract/releases.rss" />
        <link rel="canonical" href="./Archive::Extract.html" />
        <meta name="description" content="A generic archive extracting mechanism" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/Archive::Extract" />
<meta name="twitter:title"       content="Archive::Extract" />
<meta name="twitter:description" content="A generic archive extracting mechanism" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./Archive::Extract.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of Archive-Extract was released.">
      <span class="relatize">06 May 2021 13:13:45 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/Archive-Extract">Archive-Extract</a>
  </li>
  <li>
    Module version: 0.88
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/Archive-Extract/source/lib/Archive/Extract.pm">Source</a>
    (<a href="https://metacpan.org/dist/Archive-Extract/source/lib/Archive/Extract.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/Archive-Extract/source/lib/Archive">Browse</a>
    (<a href="https://metacpan.org/dist/Archive-Extract/source/lib/Archive?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/Archive-Extract/changes">Changes</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/Archive-Extract/contribute">How to Contribute</a>
    </li>
    <li>
        <a rel="noopener nofollow" data-keyboard-shortcut="g r" href="https://github.com/jib/archive-extract">Repository</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Public/Dist/Display.html?Name=Archive-Extract">Issues</a>
      (22)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=Archive-Extract+0.88" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/A/Archive-Extract.html?oncpan=1&amp;distmat=1&amp;version=0.88&amp;grade=2" style="color: #090">134</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/A/Archive-Extract.html?oncpan=1&amp;distmat=1&amp;version=0.88&amp;grade=3" style="color: #900">0</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/A/Archive-Extract.html?oncpan=1&amp;distmat=1&amp;version=0.88&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/BINGOS/Archive-Extract-0.88">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on Archive-Extract who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 1
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/Archive-Extract-0.88/index.html">66.80% Coverage </a>
    </li>
    <li>
      License: perl_5
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/Archive-Extract/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/B/BI/BINGOS/Archive-Extract-0.88.tar.gz">
      Download (<span itemprop="fileSize">27.63KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FBINGOS%2FArchive-Extract-0.88%2Flib%2FArchive%2FExtract.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Archive-Extract/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Archive-Extract/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:Archive-Extract">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="Archive-Extract">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Archive/Extract.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="BINGOS/Archive-Extract-0.88"
>0.88
  (BINGOS on 2021-05-06)</option>
<option
  
  value="BINGOS/Archive-Extract-0.86"
>0.86
  (BINGOS on 2019-12-05)</option>
<option
  
  value="KANE/Archive-Extract-0.34"
>0.34
  (KANE on 2009-06-27)</option>
<option
  
  value="KANE/Archive-Extract-0.32"
>0.32
  (KANE on 2009-06-12)</option>
<option
  
  value="KANE/Archive-Extract-0.31_03"
>0.31_03 DEV
  (KANE on 2009-03-11)</option>
<option
  
  value="KANE/Archive-Extract-0.31_02"
>0.31_02 DEV
  (KANE on 2009-03-03)</option>
<option
  
  value="KANE/Archive-Extract-0.31_01"
>0.31_01 DEV
  (KANE on 2009-02-06)</option>
<option
  
  value="KANE/Archive-Extract-0.30"
>0.30
  (KANE on 2008-12-16)</option>
<option
  
  value="KANE/Archive-Extract-0.28"
>0.28
  (KANE on 2008-10-10)</option>
<option
  
  value="KANE/Archive-Extract-0.27_02"
>0.27_02 DEV
  (KANE on 2008-09-24)</option>
<option
  
  value="KANE/Archive-Extract-0.27_01"
>0.27_01 DEV
  (KANE on 2008-09-22)</option>
<option
  
  value="KANE/Archive-Extract-0.26"
>0.26
  (KANE on 2008-01-27)</option>
<option
  
  value="KANE/Archive-Extract-0.24"
>0.24
  (KANE on 2007-09-20)</option>
<option
  
  value="KANE/Archive-Extract-0.22"
>0.22
  (KANE on 2007-05-29)</option>
<option
  
  value="KANE/Archive-Extract-0.20"
>0.20
  (KANE on 2007-05-28)</option>
<option
  
  value="KANE/Archive-Extract-0.18"
>0.18
  (KANE on 2007-04-11)</option>
<option
  
  value="KANE/Archive-Extract-0.16"
>0.16
  (KANE on 2007-01-26)</option>
<option
  
  value="KANE/Archive-Extract-0.15_03"
>0.15_03 DEV
  (KANE on 2007-01-04)</option>
<option
  
  value="KANE/Archive-Extract-0.15_01"
>0.15_01 DEV
  (KANE on 2006-11-24)</option>
<option
  
  value="KANE/Archive-Extract-0.14"
>0.14
  (KANE on 2006-10-20)</option>
<option
  
  value="KANE/Archive-Extract-0.12"
>0.12
  (KANE on 2006-08-13)</option>
<option
  
  value="KANE/Archive-Extract-0.11_02"
>0.11_02 DEV
  (KANE on 2006-08-03)</option>
<option
  
  value="KANE/Archive-Extract-0.11_01"
>0.11_01 DEV
  (KANE on 2006-08-02)</option>
<option
  
  value="KANE/Archive-Extract-0.11"
>0.11
  (KANE on 2006-08-02)</option>
<option
  
  value="KANE/Archive-Extract-0.08"
>0.08
  (KANE on 2006-01-19)</option>
<option
  
  value="KANE/Archive-Extract-0.07"
>0.07
  (KANE on 2004-12-10)</option>
<option
  
  value="KANE/Archive-Extract-0.05"
>0.05
  (KANE on 2004-12-03)</option>
<option
  
  value="KANE/Archive-Extract-0.03"
>0.03
  (KANE on 2004-08-17)</option>
<option
  
  value="KANE/Archive-Extract-0.02"
>0.02
  (KANE on 2004-08-16)</option>
<option
  
  value="KANE/Archive-Extract-0.01"
>0.01
  (KANE on 2004-06-18)</option>
<optgroup label="BackPAN">'
<option
  
  value="BINGOS/Archive-Extract-0.84"
>0.84
  (BINGOS on 2019-12-04)</option>
<option
  
  value="BINGOS/Archive-Extract-0.82"
>0.82
  (BINGOS on 2019-11-22)</option>
<option
  
  value="BINGOS/Archive-Extract-0.80"
>0.80
  (BINGOS on 2017-01-18)</option>
<option
  
  value="BINGOS/Archive-Extract-0.78"
>0.78
  (BINGOS on 2016-07-27)</option>
<option
  
  value="BINGOS/Archive-Extract-0.76"
>0.76
  (BINGOS on 2015-07-04)</option>
<option
  
  value="BINGOS/Archive-Extract-0.74"
>0.74
  (BINGOS on 2014-11-20)</option>
<option
  
  value="BINGOS/Archive-Extract-0.72"
>0.72
  (BINGOS on 2014-01-26)</option>
<option
  
  value="BINGOS/Archive-Extract-0.70"
>0.70
  (BINGOS on 2013-11-09)</option>
<option
  
  value="BINGOS/Archive-Extract-0.68"
>0.68
  (BINGOS on 2013-02-15)</option>
<option
  
  value="BINGOS/Archive-Extract-0.66"
>0.66
  (BINGOS on 2013-02-09)</option>
<option
  
  value="BINGOS/Archive-Extract-0.64"
>0.64
  (BINGOS on 2013-01-26)</option>
<option
  
  value="BINGOS/Archive-Extract-0.62"
>0.62
  (BINGOS on 2013-01-09)</option>
<option
  
  value="BINGOS/Archive-Extract-0.60"
>0.60
  (BINGOS on 2012-02-20)</option>
<option
  
  value="BINGOS/Archive-Extract-0.58"
>0.58
  (BINGOS on 2011-10-22)</option>
<option
  
  value="BINGOS/Archive-Extract-0.56"
>0.56
  (BINGOS on 2011-08-23)</option>
<option
  
  value="BINGOS/Archive-Extract-0.54"
>0.54
  (BINGOS on 2011-08-22)</option>
<option
  
  value="BINGOS/Archive-Extract-0.52"
>0.52
  (BINGOS on 2011-04-28)</option>
<option
  
  value="BINGOS/Archive-Extract-0.50"
>0.50
  (BINGOS on 2011-04-12)</option>
<option
  
  value="BINGOS/Archive-Extract-0.48"
>0.48
  (BINGOS on 2011-01-07)</option>
<option
  
  value="BINGOS/Archive-Extract-0.46"
>0.46
  (BINGOS on 2010-10-26)</option>
<option
  
  value="BINGOS/Archive-Extract-0.44"
>0.44
  (BINGOS on 2010-09-29)</option>
<option
  
  value="BINGOS/Archive-Extract-0.42"
>0.42
  (BINGOS on 2010-06-28)</option>
<option
  
  value="BINGOS/Archive-Extract-0.40"
>0.40
  (BINGOS on 2010-05-14)</option>
<option
  
  value="BINGOS/Archive-Extract-0.38"
>0.38
  (BINGOS on 2010-01-06)</option>
<option
  
  value="BINGOS/Archive-Extract-0.36"
>0.36
  (BINGOS on 2009-11-24)</option>
<option
  
  value="KANE/Archive-Extract-0.10"
>0.10
  (KANE on 2006-08-01)</option>
<option
  
  value="KANE/Archive-Extract-0.06"
>0.06
  (KANE on 2004-12-08)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/BINGOS/Archive-Extract-0.88/diff/' + encodeURIComponent(this.value) + '/lib/Archive/Extract.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="BINGOS/Archive-Extract-0.88"
>0.88
  (BINGOS on 2021-05-06)</option>
<option
  
  value="BINGOS/Archive-Extract-0.86"
>0.86
  (BINGOS on 2019-12-05)</option>
<option
  
  value="KANE/Archive-Extract-0.34"
>0.34
  (KANE on 2009-06-27)</option>
<option
  
  value="KANE/Archive-Extract-0.32"
>0.32
  (KANE on 2009-06-12)</option>
<option
  
  value="KANE/Archive-Extract-0.31_03"
>0.31_03 DEV
  (KANE on 2009-03-11)</option>
<option
  
  value="KANE/Archive-Extract-0.31_02"
>0.31_02 DEV
  (KANE on 2009-03-03)</option>
<option
  
  value="KANE/Archive-Extract-0.31_01"
>0.31_01 DEV
  (KANE on 2009-02-06)</option>
<option
  
  value="KANE/Archive-Extract-0.30"
>0.30
  (KANE on 2008-12-16)</option>
<option
  
  value="KANE/Archive-Extract-0.28"
>0.28
  (KANE on 2008-10-10)</option>
<option
  
  value="KANE/Archive-Extract-0.27_02"
>0.27_02 DEV
  (KANE on 2008-09-24)</option>
<option
  
  value="KANE/Archive-Extract-0.27_01"
>0.27_01 DEV
  (KANE on 2008-09-22)</option>
<option
  
  value="KANE/Archive-Extract-0.26"
>0.26
  (KANE on 2008-01-27)</option>
<option
  
  value="KANE/Archive-Extract-0.24"
>0.24
  (KANE on 2007-09-20)</option>
<option
  
  value="KANE/Archive-Extract-0.22"
>0.22
  (KANE on 2007-05-29)</option>
<option
  
  value="KANE/Archive-Extract-0.20"
>0.20
  (KANE on 2007-05-28)</option>
<option
  
  value="KANE/Archive-Extract-0.18"
>0.18
  (KANE on 2007-04-11)</option>
<option
  
  value="KANE/Archive-Extract-0.16"
>0.16
  (KANE on 2007-01-26)</option>
<option
  
  value="KANE/Archive-Extract-0.15_03"
>0.15_03 DEV
  (KANE on 2007-01-04)</option>
<option
  
  value="KANE/Archive-Extract-0.15_01"
>0.15_01 DEV
  (KANE on 2006-11-24)</option>
<option
  
  value="KANE/Archive-Extract-0.14"
>0.14
  (KANE on 2006-10-20)</option>
<option
  
  value="KANE/Archive-Extract-0.12"
>0.12
  (KANE on 2006-08-13)</option>
<option
  
  value="KANE/Archive-Extract-0.11_02"
>0.11_02 DEV
  (KANE on 2006-08-03)</option>
<option
  
  value="KANE/Archive-Extract-0.11_01"
>0.11_01 DEV
  (KANE on 2006-08-02)</option>
<option
  
  value="KANE/Archive-Extract-0.11"
>0.11
  (KANE on 2006-08-02)</option>
<option
  
  value="KANE/Archive-Extract-0.08"
>0.08
  (KANE on 2006-01-19)</option>
<option
  
  value="KANE/Archive-Extract-0.07"
>0.07
  (KANE on 2004-12-10)</option>
<option
  
  value="KANE/Archive-Extract-0.05"
>0.05
  (KANE on 2004-12-03)</option>
<option
  
  value="KANE/Archive-Extract-0.03"
>0.03
  (KANE on 2004-08-17)</option>
<option
  
  value="KANE/Archive-Extract-0.02"
>0.02
  (KANE on 2004-08-16)</option>
<option
  
  value="KANE/Archive-Extract-0.01"
>0.01
  (KANE on 2004-06-18)</option>
<optgroup label="BackPAN">'
<option
  
  value="BINGOS/Archive-Extract-0.84"
>0.84
  (BINGOS on 2019-12-04)</option>
<option
  
  value="BINGOS/Archive-Extract-0.82"
>0.82
  (BINGOS on 2019-11-22)</option>
<option
  
  value="BINGOS/Archive-Extract-0.80"
>0.80
  (BINGOS on 2017-01-18)</option>
<option
  
  value="BINGOS/Archive-Extract-0.78"
>0.78
  (BINGOS on 2016-07-27)</option>
<option
  
  value="BINGOS/Archive-Extract-0.76"
>0.76
  (BINGOS on 2015-07-04)</option>
<option
  
  value="BINGOS/Archive-Extract-0.74"
>0.74
  (BINGOS on 2014-11-20)</option>
<option
  
  value="BINGOS/Archive-Extract-0.72"
>0.72
  (BINGOS on 2014-01-26)</option>
<option
  
  value="BINGOS/Archive-Extract-0.70"
>0.70
  (BINGOS on 2013-11-09)</option>
<option
  
  value="BINGOS/Archive-Extract-0.68"
>0.68
  (BINGOS on 2013-02-15)</option>
<option
  
  value="BINGOS/Archive-Extract-0.66"
>0.66
  (BINGOS on 2013-02-09)</option>
<option
  
  value="BINGOS/Archive-Extract-0.64"
>0.64
  (BINGOS on 2013-01-26)</option>
<option
  
  value="BINGOS/Archive-Extract-0.62"
>0.62
  (BINGOS on 2013-01-09)</option>
<option
  
  value="BINGOS/Archive-Extract-0.60"
>0.60
  (BINGOS on 2012-02-20)</option>
<option
  
  value="BINGOS/Archive-Extract-0.58"
>0.58
  (BINGOS on 2011-10-22)</option>
<option
  
  value="BINGOS/Archive-Extract-0.56"
>0.56
  (BINGOS on 2011-08-23)</option>
<option
  
  value="BINGOS/Archive-Extract-0.54"
>0.54
  (BINGOS on 2011-08-22)</option>
<option
  
  value="BINGOS/Archive-Extract-0.52"
>0.52
  (BINGOS on 2011-04-28)</option>
<option
  
  value="BINGOS/Archive-Extract-0.50"
>0.50
  (BINGOS on 2011-04-12)</option>
<option
  
  value="BINGOS/Archive-Extract-0.48"
>0.48
  (BINGOS on 2011-01-07)</option>
<option
  
  value="BINGOS/Archive-Extract-0.46"
>0.46
  (BINGOS on 2010-10-26)</option>
<option
  
  value="BINGOS/Archive-Extract-0.44"
>0.44
  (BINGOS on 2010-09-29)</option>
<option
  
  value="BINGOS/Archive-Extract-0.42"
>0.42
  (BINGOS on 2010-06-28)</option>
<option
  
  value="BINGOS/Archive-Extract-0.40"
>0.40
  (BINGOS on 2010-05-14)</option>
<option
  
  value="BINGOS/Archive-Extract-0.38"
>0.38
  (BINGOS on 2010-01-06)</option>
<option
  
  value="BINGOS/Archive-Extract-0.36"
>0.36
  (BINGOS on 2009-11-24)</option>
<option
  
  value="KANE/Archive-Extract-0.10"
>0.10
  (KANE on 2006-08-01)</option>
<option
  
  value="KANE/Archive-Extract-0.06"
>0.06
  (KANE on 2004-12-08)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/File::Basename" title="File::Basename" class="ellipsis">File::Basename</a></li>
  <li><a href="https://metacpan.org/pod/File::Path" title="File::Path" class="ellipsis">File::Path</a></li>
  <li><a href="https://metacpan.org/pod/File::Spec" title="File::Spec" class="ellipsis">File::Spec</a></li>
  <li><a href="https://metacpan.org/pod/IPC::Cmd" title="IPC::Cmd" class="ellipsis">IPC::Cmd</a></li>
  <li><a href="https://metacpan.org/pod/Locale::Maketext::Simple" title="Locale::Maketext::Simple" class="ellipsis">Locale::Maketext::Simple</a></li>
  <li><a href="https://metacpan.org/pod/Module::Load::Conditional" title="Module::Load::Conditional" class="ellipsis">Module::Load::Conditional</a></li>
  <li><a href="https://metacpan.org/pod/Params::Check" title="Params::Check" class="ellipsis">Params::Check</a></li>
  <li><a href="https://metacpan.org/pod/Test::More" title="Test::More" class="ellipsis">Test::More</a></li>
  <li><a href="https://metacpan.org/pod/if" title="if" class="ellipsis">if</a></li>
  <li><i class="ttip" title="dynamic_config enabled">and possibly others</i></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/Archive::Extract/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=Archive%3A%3AExtract">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=Archive-Extract">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/BINGOS/Archive-Extract-0.88/view/lib/Archive/Extract.pm">This version</a>
    </li>
    <li>
      <a href="./Archive::Extract.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/THALJEF"><img src="https://www.gravatar.com/avatar/3bc1e2a3856973ca129523e6a12dfe81?d=identicon&amp;s=20" title="THALJEF" alt="THALJEF"></a>
<a class="display-all" href="https://metacpan.org/author/ZMUGHAL"><img src="https://www.gravatar.com/avatar/82e7c54d334bfdfd32594d34583d32bc?d=identicon&amp;s=20" title="ZMUGHAL" alt="ZMUGHAL"></a>
<a class="display-all" href="https://metacpan.org/author/ARISTOTLE"><img src="https://www.gravatar.com/avatar/81da52fa1b6754867e9056c58afab74d?d=identicon&amp;s=20" title="ARISTOTLE" alt="ARISTOTLE"></a>
<a class="display-all" href="https://metacpan.org/author/DAGOLDEN"><img src="https://www.gravatar.com/avatar/bb755c989fcb9897f28a2c6e00df61e2?d=identicon&amp;s=20" title="DAGOLDEN" alt="DAGOLDEN"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/Archive-Extract/plussers">4 PAUSE users</a>
</div>
<div>
    3 non-PAUSE users
</div>
</div>
    </li>
    <li>
<div id="metacpan_contributors">
  <div>
    <button class="btn-link"
      onclick="$(this).hide(); $('#metacpan_contributors ul').slideDown(); return false;"
    >and 1 contributors</button>
  </div>
  <ul style="display: none">
    <li class="contributor"
    >
      Jos Boumans &lt;kane[at]cpan.org&gt;
    </li>
  </ul>
</div>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/BINGOS" class="author-name">Chris Williams</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Archive/Extract.pm&#39;" class="">
<option
  selected
  value="BINGOS/Archive-Extract-0.88"
>0.88
  (BINGOS on 2021-05-06)</option>
<option
  
  value="BINGOS/Archive-Extract-0.86"
>0.86
  (BINGOS on 2019-12-05)</option>
<option
  
  value="KANE/Archive-Extract-0.34"
>0.34
  (KANE on 2009-06-27)</option>
<option
  
  value="KANE/Archive-Extract-0.32"
>0.32
  (KANE on 2009-06-12)</option>
<option
  
  value="KANE/Archive-Extract-0.31_03"
>0.31_03 DEV
  (KANE on 2009-03-11)</option>
<option
  
  value="KANE/Archive-Extract-0.31_02"
>0.31_02 DEV
  (KANE on 2009-03-03)</option>
<option
  
  value="KANE/Archive-Extract-0.31_01"
>0.31_01 DEV
  (KANE on 2009-02-06)</option>
<option
  
  value="KANE/Archive-Extract-0.30"
>0.30
  (KANE on 2008-12-16)</option>
<option
  
  value="KANE/Archive-Extract-0.28"
>0.28
  (KANE on 2008-10-10)</option>
<option
  
  value="KANE/Archive-Extract-0.27_02"
>0.27_02 DEV
  (KANE on 2008-09-24)</option>
<option
  
  value="KANE/Archive-Extract-0.27_01"
>0.27_01 DEV
  (KANE on 2008-09-22)</option>
<option
  
  value="KANE/Archive-Extract-0.26"
>0.26
  (KANE on 2008-01-27)</option>
<option
  
  value="KANE/Archive-Extract-0.24"
>0.24
  (KANE on 2007-09-20)</option>
<option
  
  value="KANE/Archive-Extract-0.22"
>0.22
  (KANE on 2007-05-29)</option>
<option
  
  value="KANE/Archive-Extract-0.20"
>0.20
  (KANE on 2007-05-28)</option>
<option
  
  value="KANE/Archive-Extract-0.18"
>0.18
  (KANE on 2007-04-11)</option>
<option
  
  value="KANE/Archive-Extract-0.16"
>0.16
  (KANE on 2007-01-26)</option>
<option
  
  value="KANE/Archive-Extract-0.15_03"
>0.15_03 DEV
  (KANE on 2007-01-04)</option>
<option
  
  value="KANE/Archive-Extract-0.15_01"
>0.15_01 DEV
  (KANE on 2006-11-24)</option>
<option
  
  value="KANE/Archive-Extract-0.14"
>0.14
  (KANE on 2006-10-20)</option>
<option
  
  value="KANE/Archive-Extract-0.12"
>0.12
  (KANE on 2006-08-13)</option>
<option
  
  value="KANE/Archive-Extract-0.11_02"
>0.11_02 DEV
  (KANE on 2006-08-03)</option>
<option
  
  value="KANE/Archive-Extract-0.11_01"
>0.11_01 DEV
  (KANE on 2006-08-02)</option>
<option
  
  value="KANE/Archive-Extract-0.11"
>0.11
  (KANE on 2006-08-02)</option>
<option
  
  value="KANE/Archive-Extract-0.08"
>0.08
  (KANE on 2006-01-19)</option>
<option
  
  value="KANE/Archive-Extract-0.07"
>0.07
  (KANE on 2004-12-10)</option>
<option
  
  value="KANE/Archive-Extract-0.05"
>0.05
  (KANE on 2004-12-03)</option>
<option
  
  value="KANE/Archive-Extract-0.03"
>0.03
  (KANE on 2004-08-17)</option>
<option
  
  value="KANE/Archive-Extract-0.02"
>0.02
  (KANE on 2004-08-16)</option>
<option
  
  value="KANE/Archive-Extract-0.01"
>0.01
  (KANE on 2004-06-18)</option>
<optgroup label="BackPAN">'
<option
  
  value="BINGOS/Archive-Extract-0.84"
>0.84
  (BINGOS on 2019-12-04)</option>
<option
  
  value="BINGOS/Archive-Extract-0.82"
>0.82
  (BINGOS on 2019-11-22)</option>
<option
  
  value="BINGOS/Archive-Extract-0.80"
>0.80
  (BINGOS on 2017-01-18)</option>
<option
  
  value="BINGOS/Archive-Extract-0.78"
>0.78
  (BINGOS on 2016-07-27)</option>
<option
  
  value="BINGOS/Archive-Extract-0.76"
>0.76
  (BINGOS on 2015-07-04)</option>
<option
  
  value="BINGOS/Archive-Extract-0.74"
>0.74
  (BINGOS on 2014-11-20)</option>
<option
  
  value="BINGOS/Archive-Extract-0.72"
>0.72
  (BINGOS on 2014-01-26)</option>
<option
  
  value="BINGOS/Archive-Extract-0.70"
>0.70
  (BINGOS on 2013-11-09)</option>
<option
  
  value="BINGOS/Archive-Extract-0.68"
>0.68
  (BINGOS on 2013-02-15)</option>
<option
  
  value="BINGOS/Archive-Extract-0.66"
>0.66
  (BINGOS on 2013-02-09)</option>
<option
  
  value="BINGOS/Archive-Extract-0.64"
>0.64
  (BINGOS on 2013-01-26)</option>
<option
  
  value="BINGOS/Archive-Extract-0.62"
>0.62
  (BINGOS on 2013-01-09)</option>
<option
  
  value="BINGOS/Archive-Extract-0.60"
>0.60
  (BINGOS on 2012-02-20)</option>
<option
  
  value="BINGOS/Archive-Extract-0.58"
>0.58
  (BINGOS on 2011-10-22)</option>
<option
  
  value="BINGOS/Archive-Extract-0.56"
>0.56
  (BINGOS on 2011-08-23)</option>
<option
  
  value="BINGOS/Archive-Extract-0.54"
>0.54
  (BINGOS on 2011-08-22)</option>
<option
  
  value="BINGOS/Archive-Extract-0.52"
>0.52
  (BINGOS on 2011-04-28)</option>
<option
  
  value="BINGOS/Archive-Extract-0.50"
>0.50
  (BINGOS on 2011-04-12)</option>
<option
  
  value="BINGOS/Archive-Extract-0.48"
>0.48
  (BINGOS on 2011-01-07)</option>
<option
  
  value="BINGOS/Archive-Extract-0.46"
>0.46
  (BINGOS on 2010-10-26)</option>
<option
  
  value="BINGOS/Archive-Extract-0.44"
>0.44
  (BINGOS on 2010-09-29)</option>
<option
  
  value="BINGOS/Archive-Extract-0.42"
>0.42
  (BINGOS on 2010-06-28)</option>
<option
  
  value="BINGOS/Archive-Extract-0.40"
>0.40
  (BINGOS on 2010-05-14)</option>
<option
  
  value="BINGOS/Archive-Extract-0.38"
>0.38
  (BINGOS on 2010-01-06)</option>
<option
  
  value="BINGOS/Archive-Extract-0.36"
>0.36
  (BINGOS on 2009-11-24)</option>
<option
  
  value="KANE/Archive-Extract-0.10"
>0.10
  (KANE on 2006-08-01)</option>
<option
  
  value="KANE/Archive-Extract-0.06"
>0.06
  (KANE on 2004-12-08)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/Archive-Extract">Archive-Extract-0.88</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage three &#10;
          • 70 direct dependents &#10;          • 314 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="15"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="Archive-Extract-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="Archive-Extract-0.88">
    <input type="hidden" name="author" value="BINGOS">
    <input type="hidden" name="distribution" value="Archive-Extract">
    <button type="submit" class="favorite highlight"><span>7</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./Archive::Extract.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>7</span> ++</a>
</div>
   / <span>Archive::Extract</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./Archive::Extract.html#NAME">NAME</a></li>
  <li><a href="./Archive::Extract.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./Archive::Extract.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="./Archive::Extract.html#METHODS">METHODS</a>
    <ul>
      <li><a href="./Archive::Extract.html#$ae-=-Archive::Extract-%3Enew(archive-=%3E-&#39;/path/to/archive&#39;,%5Btype-=%3E-TYPE%5D)">$ae = Archive::Extract-&gt;new(archive =&gt; &#39;/path/to/archive&#39;,[type =&gt; TYPE])</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Eextract(-%5Bto-=%3E-&#39;/output/path&#39;%5D-)">$ae-&gt;extract( [to =&gt; &#39;/output/path&#39;] )</a></li>
    </ul>
  </li>
  <li><a href="./Archive::Extract.html#ACCESSORS">ACCESSORS</a>
    <ul>
      <li><a href="./Archive::Extract.html#$ae-%3Eerror(%5BBOOL%5D)">$ae-&gt;error([BOOL])</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Eextract_path1">$ae-&gt;extract_path</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Efiles1">$ae-&gt;files</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Earchive">$ae-&gt;archive</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Etype">$ae-&gt;type</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Etypes">$ae-&gt;types</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Eis_tgz">$ae-&gt;is_tgz</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Eis_tar">$ae-&gt;is_tar</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Eis_gz">$ae-&gt;is_gz</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Eis_Z">$ae-&gt;is_Z</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Eis_zip">$ae-&gt;is_zip</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Eis_lzma">$ae-&gt;is_lzma</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Eis_xz">$ae-&gt;is_xz</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Ebin_tar">$ae-&gt;bin_tar</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Ebin_gzip">$ae-&gt;bin_gzip</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Ebin_unzip">$ae-&gt;bin_unzip</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Ebin_unlzma">$ae-&gt;bin_unlzma</a></li>
      <li><a href="./Archive::Extract.html#$ae-%3Ebin_unxz">$ae-&gt;bin_unxz</a></li>
      <li><a href="./Archive::Extract.html#$bool-=-$ae-%3Ehave_old_bunzip2">$bool = $ae-&gt;have_old_bunzip2</a></li>
      <li><a href="./Archive::Extract.html#debug(-MESSAGE-)">debug( MESSAGE )</a></li>
    </ul>
  </li>
  <li><a href="./Archive::Extract.html#UTILITY-FUNCTION">UTILITY FUNCTION</a>
    <ul>
      <li><a href="./Archive::Extract.html#type_for($archive)">type_for($archive)</a></li>
    </ul>
  </li>
  <li><a href="./Archive::Extract.html#HOW-IT-WORKS">HOW IT WORKS</a></li>
  <li><a href="./Archive::Extract.html#CAVEATS">CAVEATS</a>
    <ul>
      <li><a href="./Archive::Extract.html#File-Extensions">File Extensions</a></li>
      <li><a href="./Archive::Extract.html#Supporting-Very-Large-Files">Supporting Very Large Files</a></li>
      <li><a href="./Archive::Extract.html#Bunzip2-support-of-arbitrary-extensions.">Bunzip2 support of arbitrary extensions.</a></li>
    </ul>
  </li>
  <li><a href="./Archive::Extract.html#GLOBAL-VARIABLES">GLOBAL VARIABLES</a>
    <ul>
      <li><a href="./Archive::Extract.html#$Archive::Extract::DEBUG">$Archive::Extract::DEBUG</a></li>
      <li><a href="./Archive::Extract.html#$Archive::Extract::WARN">$Archive::Extract::WARN</a></li>
      <li><a href="./Archive::Extract.html#$Archive::Extract::PREFER_BIN">$Archive::Extract::PREFER_BIN</a></li>
    </ul>
  </li>
  <li><a href="./Archive::Extract.html#TODO-/-CAVEATS">TODO / CAVEATS</a></li>
  <li><a href="./Archive::Extract.html#BUG-REPORTS">BUG REPORTS</a></li>
  <li><a href="./Archive::Extract.html#AUTHOR">AUTHOR</a></li>
  <li><a href="./Archive::Extract.html#COPYRIGHT">COPYRIGHT</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>Archive::Extract - A generic archive extracting mechanism</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>    use Archive::Extract;

    ### build an Archive::Extract object ###
    my $ae = Archive::Extract-&gt;new( archive =&gt; &#39;foo.tgz&#39; );

    ### extract to cwd() ###
    my $ok = $ae-&gt;extract;

    ### extract to /tmp ###
    my $ok = $ae-&gt;extract( to =&gt; &#39;/tmp&#39; );

    ### what if something went wrong?
    my $ok = $ae-&gt;extract or die $ae-&gt;error;

    ### files from the archive ###
    my $files   = $ae-&gt;files;

    ### dir that was extracted to ###
    my $outdir  = $ae-&gt;extract_path;


    ### quick check methods ###
    $ae-&gt;is_tar     # is it a .tar file?
    $ae-&gt;is_tgz     # is it a .tar.gz or .tgz file?
    $ae-&gt;is_gz;     # is it a .gz file?
    $ae-&gt;is_zip;    # is it a .zip file?
    $ae-&gt;is_bz2;    # is it a .bz2 file?
    $ae-&gt;is_tbz;    # is it a .tar.bz2 or .tbz file?
    $ae-&gt;is_lzma;   # is it a .lzma file?
    $ae-&gt;is_xz;     # is it a .xz file?
    $ae-&gt;is_txz;    # is it a .tar.xz or .txz file?

    ### absolute path to the archive you provided ###
    $ae-&gt;archive;

    ### commandline tools, if found ###
    $ae-&gt;bin_tar     # path to /bin/tar, if found
    $ae-&gt;bin_gzip    # path to /bin/gzip, if found
    $ae-&gt;bin_unzip   # path to /bin/unzip, if found
    $ae-&gt;bin_bunzip2 # path to /bin/bunzip2 if found
    $ae-&gt;bin_unlzma  # path to /bin/unlzma if found
    $ae-&gt;bin_unxz    # path to /bin/unxz if found</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>Archive::Extract is a generic archive extraction mechanism.</p>

<p>It allows you to extract any archive file of the type .tar, .tar.gz, .gz, .Z, tar.bz2, .tbz, .bz2, .zip, .xz,, .txz, .tar.xz or .lzma without having to worry how it does so, or use different interfaces for each type by using either perl modules, or commandline tools on your system.</p>

<p>See the <code>HOW IT WORKS</code> section further down for details.</p>

<h1 id="METHODS">METHODS</h1>

<h2 id="$ae-=-Archive::Extract-&gt;new(archive-=&gt;-&#39;/path/to/archive&#39;,[type-=&gt;-TYPE])"><a id="ae---Archive::Extract--new-archive----path-to-archive-type---TYPE"></a>$ae = Archive::Extract-&gt;new(archive =&gt; &#39;/path/to/archive&#39;,[type =&gt; TYPE])</h2>

<p>Creates a new <code>Archive::Extract</code> object based on the archive file you passed it. Automatically determines the type of archive based on the extension, but you can override that by explicitly providing the <code>type</code> argument, potentially by calling <code>type_for()</code>.</p>

<p>Valid values for <code>type</code> are:</p>

<dl>

<dt id="tar">tar</dt>
<dd>

<p>Standard tar files, as produced by, for example, <code>/bin/tar</code>. Corresponds to a <code>.tar</code> suffix.</p>

</dd>
<dt id="tgz">tgz</dt>
<dd>

<p>Gzip compressed tar files, as produced by, for example <code>/bin/tar -z</code>. Corresponds to a <code>.tgz</code> or <code>.tar.gz</code> suffix.</p>

</dd>
<dt id="gz">gz</dt>
<dd>

<p>Gzip compressed file, as produced by, for example <code>/bin/gzip</code>. Corresponds to a <code>.gz</code> suffix.</p>

</dd>
<dt id="Z">Z</dt>
<dd>

<p>Lempel-Ziv compressed file, as produced by, for example <code>/bin/compress</code>. Corresponds to a <code>.Z</code> suffix.</p>

</dd>
<dt id="zip">zip</dt>
<dd>

<p>Zip compressed file, as produced by, for example <code>/bin/zip</code>. Corresponds to a <code>.zip</code>, <code>.jar</code> or <code>.par</code> suffix.</p>

</dd>
<dt id="bz2">bz2</dt>
<dd>

<p>Bzip2 compressed file, as produced by, for example, <code>/bin/bzip2</code>. Corresponds to a <code>.bz2</code> suffix.</p>

</dd>
<dt id="tbz">tbz</dt>
<dd>

<p>Bzip2 compressed tar file, as produced by, for example <code>/bin/tar -j</code>. Corresponds to a <code>.tbz</code> or <code>.tar.bz2</code> suffix.</p>

</dd>
<dt id="lzma">lzma</dt>
<dd>

<p>Lzma compressed file, as produced by <code>/bin/lzma</code>. Corresponds to a <code>.lzma</code> suffix.</p>

</dd>
<dt id="xz">xz</dt>
<dd>

<p>Xz compressed file, as produced by <code>/bin/xz</code>. Corresponds to a <code>.xz</code> suffix.</p>

</dd>
<dt id="txz">txz</dt>
<dd>

<p>Xz compressed tar file, as produced by, for example <code>/bin/tar -J</code>. Corresponds to a <code>.txz</code> or <code>.tar.xz</code> suffix.</p>

</dd>
</dl>

<p>Returns a <code>Archive::Extract</code> object on success, or false on failure.</p>

<h2 id="$ae-&gt;extract(-[to-=&gt;-&#39;/output/path&#39;]-)"><a id="ae--extract---to----output-path"></a>$ae-&gt;extract( [to =&gt; &#39;/output/path&#39;] )</h2>

<p>Extracts the archive represented by the <code>Archive::Extract</code> object to the path of your choice as specified by the <code>to</code> argument. Defaults to <code>cwd()</code>.</p>

<p>Since <code>.gz</code> files never hold a directory, but only a single file; if the <code>to</code> argument is an existing directory, the file is extracted there, with its <code>.gz</code> suffix stripped. If the <code>to</code> argument is not an existing directory, the <code>to</code> argument is understood to be a filename, if the archive type is <code>gz</code>. In the case that you did not specify a <code>to</code> argument, the output file will be the name of the archive file, stripped from its <code>.gz</code> suffix, in the current working directory.</p>

<p><code>extract</code> will try a pure perl solution first, and then fall back to commandline tools if they are available. See the <code>GLOBAL VARIABLES</code> section below on how to alter this behaviour.</p>

<p>It will return true on success, and false on failure.</p>

<p>On success, it will also set the follow attributes in the object:</p>

<dl>

<dt id="$ae-&gt;extract_path"><a id="ae--extract_path"></a>$ae-&gt;extract_path</dt>
<dd>

<p>This is the directory that the files where extracted to.</p>

</dd>
<dt id="$ae-&gt;files"><a id="ae--files"></a>$ae-&gt;files</dt>
<dd>

<p>This is an array ref with the paths of all the files in the archive, relative to the <code>to</code> argument you specified. To get the full path to an extracted file, you would use:</p>

<pre><code>    File::Spec-&gt;catfile( $to, $ae-&gt;files-&gt;[0] );</code></pre>

<p>Note that all files from a tar archive will be in unix format, as per the tar specification.</p>

</dd>
</dl>

<h1 id="ACCESSORS">ACCESSORS</h1>

<h2 id="$ae-&gt;error([BOOL])"><a id="ae--error-BOOL"></a>$ae-&gt;error([BOOL])</h2>

<p>Returns the last encountered error as string. Pass it a true value to get the <code>Carp::longmess()</code> output instead.</p>

<h2 id="$ae-&gt;extract_path1"><a id="ae--extract_path1"></a>$ae-&gt;extract_path</h2>

<p>This is the directory the archive got extracted to. See <code>extract()</code> for details.</p>

<h2 id="$ae-&gt;files1"><a id="ae--files1"></a>$ae-&gt;files</h2>

<p>This is an array ref holding all the paths from the archive. See <code>extract()</code> for details.</p>

<h2 id="$ae-&gt;archive"><a id="ae--archive"></a>$ae-&gt;archive</h2>

<p>This is the full path to the archive file represented by this <code>Archive::Extract</code> object.</p>

<h2 id="$ae-&gt;type"><a id="ae--type"></a>$ae-&gt;type</h2>

<p>This is the type of archive represented by this <code>Archive::Extract</code> object. See accessors below for an easier way to use this. See the <code>new()</code> method for details.</p>

<h2 id="$ae-&gt;types"><a id="ae--types"></a>$ae-&gt;types</h2>

<p>Returns a list of all known <code>types</code> for <code>Archive::Extract</code>&#39;s <code>new</code> method.</p>

<h2 id="$ae-&gt;is_tgz"><a id="ae--is_tgz"></a>$ae-&gt;is_tgz</h2>

<p>Returns true if the file is of type <code>.tar.gz</code>. See the <code>new()</code> method for details.</p>

<h2 id="$ae-&gt;is_tar"><a id="ae--is_tar"></a>$ae-&gt;is_tar</h2>

<p>Returns true if the file is of type <code>.tar</code>. See the <code>new()</code> method for details.</p>

<h2 id="$ae-&gt;is_gz"><a id="ae--is_gz"></a>$ae-&gt;is_gz</h2>

<p>Returns true if the file is of type <code>.gz</code>. See the <code>new()</code> method for details.</p>

<h2 id="$ae-&gt;is_Z"><a id="ae--is_Z"></a>$ae-&gt;is_Z</h2>

<p>Returns true if the file is of type <code>.Z</code>. See the <code>new()</code> method for details.</p>

<h2 id="$ae-&gt;is_zip"><a id="ae--is_zip"></a>$ae-&gt;is_zip</h2>

<p>Returns true if the file is of type <code>.zip</code>. See the <code>new()</code> method for details.</p>

<h2 id="$ae-&gt;is_lzma"><a id="ae--is_lzma"></a>$ae-&gt;is_lzma</h2>

<p>Returns true if the file is of type <code>.lzma</code>. See the <code>new()</code> method for details.</p>

<h2 id="$ae-&gt;is_xz"><a id="ae--is_xz"></a>$ae-&gt;is_xz</h2>

<p>Returns true if the file is of type <code>.xz</code>. See the <code>new()</code> method for details.</p>

<h2 id="$ae-&gt;bin_tar"><a id="ae--bin_tar"></a>$ae-&gt;bin_tar</h2>

<p>Returns the full path to your tar binary, if found.</p>

<h2 id="$ae-&gt;bin_gzip"><a id="ae--bin_gzip"></a>$ae-&gt;bin_gzip</h2>

<p>Returns the full path to your gzip binary, if found</p>

<h2 id="$ae-&gt;bin_unzip"><a id="ae--bin_unzip"></a>$ae-&gt;bin_unzip</h2>

<p>Returns the full path to your unzip binary, if found</p>

<h2 id="$ae-&gt;bin_unlzma"><a id="ae--bin_unlzma"></a>$ae-&gt;bin_unlzma</h2>

<p>Returns the full path to your unlzma binary, if found</p>

<h2 id="$ae-&gt;bin_unxz"><a id="ae--bin_unxz"></a>$ae-&gt;bin_unxz</h2>

<p>Returns the full path to your unxz binary, if found</p>

<h2 id="$bool-=-$ae-&gt;have_old_bunzip2"><a id="bool----ae--have_old_bunzip2"></a>$bool = $ae-&gt;have_old_bunzip2</h2>

<p>Older versions of <code>/bin/bunzip2</code>, from before the <code>bunzip2 1.0</code> release, require all archive names to end in <code>.bz2</code> or it will not extract them. This method checks if you have a recent version of <code>bunzip2</code> that allows any extension, or an older one that doesn&#39;t.</p>

<h2 id="debug(-MESSAGE-)"><a id="debug"></a><a id="debug--MESSAGE"></a>debug( MESSAGE )</h2>

<p>This method outputs MESSAGE to the default filehandle if <code>$DEBUG</code> is true. It&#39;s a small method, but it&#39;s here if you&#39;d like to subclass it so you can so something else with any debugging output.</p>

<h1 id="UTILITY-FUNCTION"><a id="UTILITY"></a>UTILITY FUNCTION</h1>

<h2 id="type_for($archive)"><a id="type_for"></a><a id="type_for-archive"></a>type_for($archive)</h2>

<p>Given an archive file name, it determins the type by parsing the file name extension. Used by <code>new()</code> when the <code>type</code> parameter is not passed. Also useful when the archive file does not include a suffix but the file name is otherwise known, such as when a file is uploaded to a web server and stored with a temporary name that differs from the original name, and you want to use the same detection pattern as Archive::Extract. Example:</p>

<pre><code>  my $ae = Archive::Extract-&gt;new(
      archive =&gt; &#39;/tmp/02af6s&#39;,
      type    =&gt; Archive::Extract::type_for(&#39;archive.zip&#39;),
  );</code></pre>

<h1 id="HOW-IT-WORKS"><a id="HOW"></a>HOW IT WORKS</h1>

<p><code>Archive::Extract</code> tries first to determine what type of archive you are passing it, by inspecting its suffix. It does not do this by using Mime magic, or something related. See <code>CAVEATS</code> below.</p>

<p>Once it has determined the file type, it knows which extraction methods it can use on the archive. It will try a perl solution first, then fall back to a commandline tool if that fails. If that also fails, it will return false, indicating it was unable to extract the archive. See the section on <code>GLOBAL VARIABLES</code> to see how to alter this order.</p>

<h1 id="CAVEATS">CAVEATS</h1>

<h2 id="File-Extensions"><a id="File"></a>File Extensions</h2>

<p><code>Archive::Extract</code> trusts on the extension of the archive to determine what type it is, and what extractor methods therefore can be used. If your archives do not have any of the extensions as described in the <code>new()</code> method, you will have to specify the type explicitly, or <code>Archive::Extract</code> will not be able to extract the archive for you.</p>

<h2 id="Supporting-Very-Large-Files"><a id="Supporting"></a>Supporting Very Large Files</h2>

<p><code>Archive::Extract</code> can use either pure perl modules or command line programs under the hood. Some of the pure perl modules (like <code>Archive::Tar</code> and Compress::unLZMA) take the entire contents of the archive into memory, which may not be feasible on your system. Consider setting the global variable <code>$Archive::Extract::PREFER_BIN</code> to <code>1</code>, which will prefer the use of command line programs and won&#39;t consume so much memory.</p>

<p>See the <code>GLOBAL VARIABLES</code> section below for details.</p>

<h2 id="Bunzip2-support-of-arbitrary-extensions."><a id="Bunzip2"></a><a id="Bunzip2-support-of-arbitrary-extensions"></a>Bunzip2 support of arbitrary extensions.</h2>

<p>Older versions of <code>/bin/bunzip2</code> do not support arbitrary file extensions and insist on a <code>.bz2</code> suffix. Although we do our best to guard against this, if you experience a bunzip2 error, it may be related to this. For details, please see the <code>have_old_bunzip2</code> method.</p>

<h1 id="GLOBAL-VARIABLES"><a id="GLOBAL"></a>GLOBAL VARIABLES</h1>

<h2 id="$Archive::Extract::DEBUG"><a id="Archive::Extract::DEBUG"></a>$Archive::Extract::DEBUG</h2>

<p>Set this variable to <code>true</code> to have all calls to command line tools be printed out, including all their output. This also enables <code>Carp::longmess</code> errors, instead of the regular <code>carp</code> errors.</p>

<p>Good for tracking down why things don&#39;t work with your particular setup.</p>

<p>Defaults to <code>false</code>.</p>

<h2 id="$Archive::Extract::WARN"><a id="Archive::Extract::WARN"></a>$Archive::Extract::WARN</h2>

<p>This variable controls whether errors encountered internally by <code>Archive::Extract</code> should be <code>carp</code>&#39;d or not.</p>

<p>Set to false to silence warnings. Inspect the output of the <code>error()</code> method manually to see what went wrong.</p>

<p>Defaults to <code>true</code>.</p>

<h2 id="$Archive::Extract::PREFER_BIN"><a id="Archive::Extract::PREFER_BIN"></a>$Archive::Extract::PREFER_BIN</h2>

<p>This variables controls whether <code>Archive::Extract</code> should prefer the use of perl modules, or commandline tools to extract archives.</p>

<p>Set to <code>true</code> to have <code>Archive::Extract</code> prefer commandline tools.</p>

<p>Defaults to <code>false</code>.</p>

<h1 id="TODO-/-CAVEATS"><a id="TODO"></a><a id="TODO---CAVEATS"></a>TODO / CAVEATS</h1>

<dl>

<dt id="Mime-magic-support"><a id="Mime"></a>Mime magic support</dt>
<dd>

<p>Maybe this module should use something like <code>File::Type</code> to determine the type, rather than blindly trust the suffix.</p>

</dd>
<dt id="Thread-safety"><a id="Thread"></a>Thread safety</dt>
<dd>

<p>Currently, <code>Archive::Extract</code> does a <code>chdir</code> to the extraction dir before extraction, and a <code>chdir</code> back again after. This is not necessarily thread safe. See <code>rt.cpan.org</code> bug <code>#45671</code> for details.</p>

</dd>
</dl>

<h1 id="BUG-REPORTS"><a id="BUG"></a>BUG REPORTS</h1>

<p>Please report bugs or other issues to &lt;bug-archive-extract@rt.cpan.org&gt;.</p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>This module by Jos Boumans &lt;kane@cpan.org&gt;.</p>

<h1 id="COPYRIGHT">COPYRIGHT</h1>

<p>This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install Archive::Extract, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm Archive::Extract</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install Archive::Extract</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./Archive::Extract.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
